package com.jdls.day01.test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 * @author 嘉德罗斯
 * @date 2021/8/19
 */
public class test1 {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        String usl = "jdbc:mysql://127.0.0.1:3306/db?useSSL=false";
        String use = "root";
        String password = "1234";
        Connection co = DriverManager.getConnection(usl, use, password);
        String sql = "UPDATE emp SET id = 1 WHERE ename = '孙悟空'";
        Statement st = co.createStatement();
        int execute = st.executeUpdate(sql);
        System.out.println(execute);
        st.close();
        co.close();
    }
}
